Dr Stelios Sotiriadis
C++ Foundations for
Solving Global Challenges
Who am I?
1. PROFILE
A. Professor of CS at Birkbeck, and CEO of Warestack.
Previously at UofT, visiting Prof at ND and Boston University
2. TEACHING
Computer Science, Data Engineering, and Applied Artificial
Intelligence. Prog. Director of MSc Data Science & AI
3. RESEARCH
Make computer systems and developers work faster and
better. Projects with IBM, Huawei, Autodesk and startups
Learning outcomes
1. Explain what a C++ program is
2. Use variables and input/output
3. Apply conditionals and loops to make decisions
4. Understand how code processes real-world data
5. See how software helps address global challenges
Lesson Roadmap
1. Programming and Global Challenges (5 min)
2. C++ foundations (15 min)
3. Applied global challenge example (15 min)
4. Interactive exercise (10 min)
5. Reflection and Q&A (5 min)
Programming and Global Challenges
PART 1
Interdisciplinary use case
Fake news are spreading online.
How could we verify if information is
real?
How could code help with classifying fake content?
Data
[news]
Decision
[fake/legit]
Method
[rank]
Action
[flag]
We’ll build a small version of this analysis pipeline today.
Why learn C++ as a non-CS students?
Programming = modern literacy
Data exists in every field
C++ helps build tools for problem solving
Real world data analysis and processing foundations
C++ is powering global systems
MEDICAL IMAGING
CLIMATE MODELING AUTONOMOUS SYSTEMS
Programming = Problem Solving
Programming is not only about writing code; it's about systematic thinking.
C++ foundations
PART 2
What is C++?
A programming language used to build software:
Runs very fast & used for high-performance systems
Solves real-world problems
Powers operating systems, games, real-time systems, and AI
Is chosen when performance and reliability matter.
What is a program?
A set of instructions designed to process information and solve a problem.
INPUT
User, data, systems
PROCESSING
Analytics & Decisions
OUTPUP
Files, Alerts, Graphs
What is the INPUT, PROCESSING and OUTPUT?
Given a dataset of news articles, determine which ones are most likely fake or
AI-generated
INPUT
?
PROCESSING
?
OUTPUP
?
INPUT
Dataset of news
articles
PROCESSING
Analyze and classify each
article content
OUTPUP
Articles most likely to
be AI-generated/fake
Your First C++ Program
#include <iostream>
int main() {
std::cout << "Fake News!";
return 0;
}
Tells C++ to include the input/output library
Every C++ program starts running from main
Prints Fake News! in the screen
This ends the program
The Path from Code to Action
WRITE CODE
Human-readable
instructions
TRANSFORM
Code to machine
language
RUN SCRIPT
Computer runs the
instructions
WRITE SOURCE CODE
COMPILE
EXECUTE
C++ Compiler
A C++ compiler is a program that translates your human-written code into machine code
so the computer can run it.
Compile
Ah, I now
understand
My file
My
code
Compile the source
code
(hello.cpp)
Into machine code
(hello)
Executable with
machine code
Run the executable file
Observe the output
Storing data for analysis
We store data into variables and assign
them a data type.
int age = 22;
string name = Fatima;
variable
Integer
Text
type
Data take memory space
Why assign a data type?
Computers need to know how much "space" (memory) to reserve.
32 bytes
4 bytes
16 bytes
Text: Stelios
Number: 5.000.000
pi (3.14) ~20 digits
Exploring the fake news dataset
id title read_length_min ai_gen_score flagged_fake
101 Flood hits coastal city overnight 2.5 0.76 true
int
* Integer numbers
double
* Decimal points (floats) numbers
string
* Contains letters + numbers
double
* Decimal points (floats) numbers
bool
* True or False data
Group quiz: What are the data labels and types?
city country temperature_c percipitation humidity wind_mph date_time weather raining
Doha Qatar 27 0.00 0.47 6 Sunday, 13:00 Sunny false
STRING
STRING
INT DOUBLE DOUBLE INT STRING STRING BOOL
Help me find a few!
STRING
INT
DOUBLE BOOL
What we learned by now
What is C++?
Programming language
What is a program?
A set of steps to solve a problem
What is a compiler?
A program that translates source to machine code
What are the basics data types?
int (whole), double (decimal), string (text), bool (true/false)
Break!
C++ Applied global challenges
PART 3
Fake News Analyzer Building a simple analytics pipeline
Programs become powerful when they react to user input.
Allows for dynamic data collection in the field or from laboratory devices.
INPUT
Article score
PROCESSING
Thresholds & Rules
OUTPUP
Classification & warnings
Programming is about INPUT / OUTPUT
#include <iostream>
int main() {
double ai_score;
std::cout << "Enter AI-generation probability (01): ";
std::cin >> ai_score;
std::cout << "The article's AI probability is: " << ai_score;
return 0;
}
Declare variable
Output
Input
End
Start
Store in variable
Output
Quiz (Individual)
#include <iostream>
int _______() {
_______ source_trust;
_______ fact_score;
_______ << "Enter source trust score (0100): ";
_______ >> source_trust;
_______ << "Enter fact-check score (0100): ";
_______ >> fact_score;
_______ credibility = (source_trust * 0.6) + (fact_score * 0.4);
_______ << "Credibility score: " << credibility;
return _____;
}
main
double
std::cout
std::cin
double
std::cout
0
std::cin double 0
std::cout main
double
std::cout
std::cin
Fill up the spaces
int
What does this program do?
#include <iostream>
using namespace std;
int main() {
double a, b;
cout << "Enter two numbers: ";
cin >> a >> b;
cout << "Result: " << a / b;
return 0;
}
Asks the user to enter two numbers and display their
division on the screen.
What is the problem with this code? Turn to the
person next to you and discuss
What if the inputs are 5 and 0 ?
Denominator (b) cannot be zero!
Decision Logic
We use logic to define "rules" for our systems
Allows the program to choose between different actions
The foundation of automated decision support
What if the AI score is very high?
Should we warn the user?
Decision Logic
START
READ SCORE
SCORE > 0.7
WARNING! AI GENERATED
ARTICLE
ARTICLE APPEARS CREDIBLE
END
falsetrue
If an article’s “fake score” is greater than
70%, inform the user accordingly.
Example script
double ai_score;
cout << "Enter AI probability score (01): ";
cin >> ai_score;
if (ai_score > 0.7)
{ std::cout << "Warning: This article is likely AI-generated or fake."; }
else
{ std::cout << "This article appears credible."; }
if runs code when a condition is true.
else runs code when the condition is false.
C++ Comparison Operators
Comparison operators are used to compare two values.
They always return true or false.
Operator
Meaning
Example
Result
==
equal to
5 == 5
true
!=
not equal to
5 != 3
true
>
greater than
7 > 3
true
<
less than
22 < 10
false
>=
greater than or equal to
5 >= 5
true
<=
less than or equal to
4 <= 3
false
Lets fix the division
#include <iostream>
using namespace std;
int main() {
double a, b;
cout << "Enter two numbers: ";
cin >> a >> b;
___________
{ cout << "Error: cannot divide by zero.” }
___________
{ cout << "Result: " << a / b }
return 0;
}
#include <iostream>
using namespace std;
int main() {
double a, b;
cout << "Enter two numbers: ";
cin >> a >> b;
cout << "Result: " << a / b;
return 0;
}
PATH 1?
PATH 2?
if (b == 0)
else
You might have more than two decisions
Given an AI probability score, classify
an article according its ai_score.
* Assume numbers are always between 0 and 1.
LOW
0-39%
MEDIUM
40%-79%
HIGH
80%-100%
if (ai_score >= 0.8)
{ cout << "High risk ↑"; }
else if (ai_score >= 0.4)
{ cout << "Medium risk "; }
else
{ cout << "Low risk ↓"; }
We rarely analyze just one news article
What if we have 100s of articles?
Repeatedly examine multiple articles and flag
those likely to be fake.
PROBLEM
SOLUTION
Analyze
Real
Analyze
Real
Analyze
Fake!
Analyze
Real
Analyze
Real
Building loops
A loop repeats the same instructions multiple times.
* Loop runs the same code five times.
for (int i = 1; i <= 5; i++) {
std::cout << i;
}
for repeat code
i = 1 start counting at 1
i <= 5 stop after 5 times
i++ increase by 1 each time
cout prints the message
Scan 5 articles and check their AI-probability scores
Use a loop to repeat instructions
for (int id = 1; id <= 5; id++) {
...
if (ai_score > 0.7)
{ ..."is likely fake.... }
else
{ ..."seems credible. ... }
}
for (int id = 1; id <= 5; id++) {
...
if (ai_score > 0.7)
{ ..."is likely fake.... }
else
{ ..."seems credible. ... }
}
More to come
soon!
Interactive exercises
PART 4
Reflection
PART 5
Discuss examples of interdisciplinary impact
Computer science + policy
misinformation regulation: fake news and digital policies
Computer science + climate science
environmental modelling: predict floods, heatwaves, or rising sea levels
Computer science + healthcare
medical diagnostics: analyse medical images or patient data
Computer science + business
risk analytics: detect fraud and manage investment risk
Key Takeaways
Programming = problem solving
Input decision output
Loops + conditionals for real data
Code can address real-world issues
Example: detecting misinformation
Summarizing Teaching
Approach
Start with real-world problem
Build concepts step by step
Ask questions and predict
outcomes
Short interactive activity
Connect to multiple
disciplines
Questions?
“Everybody should learn how to program a computer, because it
teaches you how to think”
Steve Jobs